﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Pages_CallClosure" Codebehind="CallClosure.aspx.cs" MasterPageFile="~/Pages/Master/MainAdmin.Master"%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script src="../../JavaScript/FieldFormatters.js" type="text/javascript"></script>

        <fieldset id="pageLoad">
            <div id="fillInData">
               <h1>Encerramento de Chamado</h1>
               <fieldset id="filter">
               <legend>Filtrar por</legend>
               <div class="fillInDataField">
                    <div class="label">
                        <label for="txbId">ID</label>
                    </div>
                    <asp:TextBox ID="txbId" runat="server" CssClass="component tiny"></asp:TextBox>
               </div>

               <div class="fillInDataField">
                    <div class="label">
                        <label for="txbDataOpening">Data de Abertura</label>
                    </div>
                    <asp:TextBox ID="txbDataOpening" runat="server" CssClass="component small" OnKeyUp="formatDate(this, event); "></asp:TextBox>
               </div>

               <div class="fillInDataField">
                    <div class="label">
                        <label for="ddlCallCategory">Categoria</label>
                    </div>
                        <asp:DropDownList ID="ddlCallCategory" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlCallCategory_SelectedIndexChanged" 
                        CssClass="component medium">
                        </asp:DropDownList>
                </div>

                <div class="fillInDataField">
                    <div class="label">
                        <label for="ddlCallSubCategory">Subcategoria</label>
                    </div>
                        <asp:DropDownList ID="ddlCallSubCategory" runat="server" 
                        CssClass="component medium">
                        </asp:DropDownList>
                </div>

               <div class="fillInDataField">
                    <div class="label">
                        <label for="txbProblemDescription">Descrição do Problema</label>
                    </div>
                    <asp:TextBox ID="txbProblemDescription" runat="server" 
                        CssClass="component big" ></asp:TextBox>
               </div>

                
                </fieldset>
                <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                    Text="Pesquisar" CssClass="button find" />

                <div class="fillInDataField">
                    <asp:GridView ID="gvCall" runat="server" AutoGenerateColumns="False" 
                        onrowcommand="gvCall_RowCommand" CellPadding="4" 
                        Font-Size="Small" ForeColor="#333333" GridLines="None" 
                        Font-Names="Courier New" Width="100%" AllowPaging="True" Height="20%">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Id" HeaderText="ID" SortExpression="Id" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DateOpening" HeaderText="Data de Abertura" 
                                SortExpression="DateOpening" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DateClosing" HeaderText="Data de Encerramento" 
                                SortExpression="DateClosing" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="ProblemDescription" HeaderText="Problema" 
                                SortExpression="ProblemDescription" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="SolutionDescription" 
                                HeaderText="Solução" SortExpression="SolutionDescription" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Solicitante" SortExpression="UserOpen">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("UserOpen") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("UserOpen.Name") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Categoria" 
                                SortExpression="CallSubCategory">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("CallSubCategory.CallCategory.Description") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Subcategoria" 
                                SortExpression="CallSubCategory">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("CallSubCategory.Description") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Unidade" SortExpression="Sector">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Sector") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Sector.Unit.Name") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Setor" SortExpression="Sector">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Sector") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Sector.Description") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Status" SortExpression="CallStatus">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CallStatus") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CallStatus.Description") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField>                
                                <ItemTemplate>
                                    <asp:LinkButton runat= "server"  ID="lblCallClosure" CommandArgument='<%# Bind("Id") %>' CommandName="CallClosure" > <img src="../../Images/Icon/FINISH_24x24.png" alt="Finalizar"/> </asp:LinkButton>                      
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                </div>
                </div>
         </fieldset>
</asp:Content>